//
//  AbstractBaseViewController.h
//  MISCloud
//
//  Created by goldeney on 13-8-16.
//  Copyright (c) 2013年 goldeneye. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "JGProgressHUD.h"
#import "JGProgressHUDFadeZoomAnimation.h"
#import "JGProgressHUDSuccessIndicatorView.h"
#import "JGProgressHUDErrorIndicatorView.h"

#import "UINavigationBar+Awesome.h"

@protocol BackResultDataDelagate <NSObject>

@optional
- (void) backResultDataKey:(id)key dataValue:(id)backValue;
- (void) backResultDataKey:(id)keyValue sender:(id)senderValue dataValue:(id)backValue;
- (void) backResultData:(id)dataValue object:(id)object;

@end


@interface AbstractBaseViewController : UIViewController <BackResultDataDelagate,JGProgressHUDDelegate>

@property (weak, nonatomic) id<BackResultDataDelagate> backResultDelagate;
@property (strong, nonatomic) id key;
@property (strong, nonatomic) id sender;
@property (strong, nonatomic) id value;
@property (strong, nonatomic) id tagObject;

@property (strong, nonatomic) UITapGestureRecognizer *tapGr;
@property (strong, nonatomic) UISwipeGestureRecognizer *swipeGr;

//设置返回到该页面需要的识别标记
- (void) setTagKey:(id)keyValue;

//设置返回到该页面需要的识别标记（UIButton）
- (void) setTagSender:(id)senderValue;

//设置传递到该页面数据
- (id)initWithValue:(id)object;

//设置传递值
- (void)setValue:(id)object;

//在返回页面需要实现的方法，用于上一个页面返回参数
- (void) backResultDataKey:(id)key dataValue:(id)backValue;
- (void) backResultDataKey:(id)keyValue sender:(id)senderValue dataValue:(id)backValue;

//进度条显示、错误提示、成功提示
- (JGProgressHUD *)showProgressHUDText:(NSString*)text;
- (JGProgressHUD *)showSimpleHUDText:(NSString*)text;
- (JGProgressHUD *)showSuccessHUDText:(NSString*)text;
- (JGProgressHUD *)showErrorHUDText:(NSString*)text;

- (JGProgressHUD *)showSuccessHUDText:(NSString*)text dismissAfterDelay:(CGFloat)delay;
- (JGProgressHUD *)showErrorHUDText:(NSString*)text dismissAfterDelay:(CGFloat)delay;

//返回事件
- (void)backButtonEvent:(id)sender;

//开启、关闭键盘事件
-(void)enableKeyboardManger;
-(void)disableKeyboardManager;

//获取上一个页面传递的参数
- (void)getPassingParameter:(id)object;

//设置标题和副标题
- (void)setTitle:(NSString *)title subtitle:(NSString*)subtitle;

//设置副标题
- (void)setSubtitle:(NSString*)subtitle;

@end
